li=[2,3,1,6,5,9,8,10,11]
def f(li):
    leng=len(li)
    mid=li[leng//2]

    right=[x for x in li if x>mid]
    mide=[x for x in li if x==mid]
    left=[x for x in li if x<mid]

    return f(left)+mide+f(right)

f(li)